import 'package:flutter_test/flutter_test.dart';
import 'package:mdict_flutter_plugin/mdict_flutter_plugin.dart';
import 'package:mdict_flutter_plugin/mdict_flutter_plugin_platform_interface.dart';
import 'package:mdict_flutter_plugin/mdict_flutter_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMdictFlutterPluginPlatform
    with MockPlatformInterfaceMixin
    implements MdictFlutterPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final MdictFlutterPluginPlatform initialPlatform = MdictFlutterPluginPlatform.instance;

  test('$MethodChannelMdictFlutterPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMdictFlutterPlugin>());
  });

  test('getPlatformVersion', () async {
    MdictFlutterPlugin mdictFlutterPlugin = MdictFlutterPlugin();
    MockMdictFlutterPluginPlatform fakePlatform = MockMdictFlutterPluginPlatform();
    MdictFlutterPluginPlatform.instance = fakePlatform;

    expect(await mdictFlutterPlugin.getPlatformVersion(), '42');
  });
}
